home *** CD-ROM | disk | FTP | other *** search
- LISTING 17 - The Person class implementation
- // person.cpp
- #include <iostream.h>
- #include "person.h"
-
- Person::Person(const string& l, const string& f,
- const Date& b, const string& s)
- : last(l), first(f), birth(b), ssn(s)
- {}
-
- ostream& operator<<(ostream& os, const Person& p)
- {
- os << '{'
- << p.last << ','
- << p.first << ','
- << '[' << p.birth << ']' << ','
- << p.ssn
- << '}';
- return os;
- }
-
- bool Person::operator==(const Person & p) const
- {
- return last == p.last &&
- first == p.first &&
- birth == p.birth &&
- ssn == p.ssn;
- }
-
-